﻿@using ClassBLL
@using ClassModel
@using ClassCommon


@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_ScheduleClass_View.cshtml";


    int userid = HttpCookieHelper.GetUserID();
    int pageIndex;
    if (!int.TryParse(this.Request["page"], out pageIndex))
    {
        pageIndex = 0;
    }
    List<t_class_task> list = t_class_task_BLL.List(userid, pageIndex, 10).ToList();
}



@section headerPartial {

    <div class="modal fade" id="myModalUserInfo" tabindex="-1" role="dialog" aria-hidden="false" data-backdrop="static" data-keyboard="false">
        <div class="modal-dialog">
            <div class="modal-content" id="modal1">
                <div class="modal-header">
                    <button id="btnClose" type="button" class="close" data-dismiss="modal">
                        x
                    </button>
                    <div class="modal-title">
                        <b>完善信息，免费获得排课秘籍</b>
                    </div>
                </div>
                <div class="modal-body">
                    <form class="form-horizontal" role="form">
                        <div class="form-group">
                            <label for="list_school_name" class="col-sm-2 control-label">*学校全称</label>
                            <div class="col-sm-9" style="height: 55px;">
                                <div>
                                    <input id="list_school_name" type="text" class="form-control" placeholder="学校全称" aria-describedby="basic-addon1" maxlength="20"
                                        style="display: inline;">
                                </div>
                                <span id="inputError1" for="list_school_name" class="label label-danger" style="visibility: hidden">学校全称必填</span>
                            </div>
                            <br>
                            <br>
                            <label for="list_area" class="col-sm-2 control-label">*所在地区</label>
                            <div class="col-sm-9" style="height: 55px;">
                                <link rel="stylesheet" href="/Static/Template/css/city-picker.css">
                                <script src="/Static/Template/js/city-picker.data.js"></script>
                                <script src="/Static/Template/js/city-picker.js"></script>
                                <div data-toggle="city-picker" class="form-control city-picker-input">
                                    <input id="list_area" readonly="" type="text">
                                </div>
                                @* <span class="city-picker-span" style="width: 1440px; height: 34px; line-height: 33px;">
                                    <span class="placeholder">请选择地区</span>
                                    <span class="title1" style="display: none;"></span>
                                    <div class="arrow"></div>
                                </span>*@
                                <div class="city-picker-dropdown" style="left: 0px; top: 100%; width: 1440px; display: none;">
                                    <div class="city-select-wrap">
                                        <div class="city-select-tab">
                                            <a class="active" data-count="province">省份</a>
                                            <a data-count="city">城市</a>
                                            <a data-count="district">区县</a>
                                        </div>
                                        <div class="city-select-content">
                                            <div class="city-select province" data-count="province" style="display: block;">
                                                <dl class="clearfix">
                                                    <dt>A-G</dt>
                                                    <dd>
                                                        <a title1="安徽省" data-code="340000" class="">安徽省</a>
                                                        <a title1="北京市" data-code="110000" class="">北京市</a>
                                                        <a title1="重庆市" data-code="500000" class="">重庆市</a>
                                                        <a title1="福建省" data-code="350000" class="">福建省</a>
                                                        <a title1="甘肃省" data-code="620000" class="">甘肃省</a>
                                                        <a title1="广东省" data-code="440000" class="">广东省</a>
                                                        <a title1="广西壮族自治区" data-code="450000" class="">广西壮族自治区</a>
                                                        <a title1="贵州省" data-code="520000" class="">贵州省</a>
                                                    </dd>
                                                </dl>
                                                <dl class="clearfix">
                                                    <dt>H-K</dt>
                                                    <dd>
                                                        <a title1="海南省" data-code="460000" class="">海南省</a>
                                                        <a title1="河北省" data-code="130000" class="">河北省</a>
                                                        <a title1="黑龙江省" data-code="230000" class="">黑龙江省</a>
                                                        <a title1="河南省" data-code="410000" class="">河南省</a>
                                                        <a title1="湖北省" data-code="420000" class="">湖北省</a>
                                                        <a title1="湖南省" data-code="430000" class="">湖南省</a>
                                                        <a title1="江苏省" data-code="320000" class="">江苏省</a>
                                                        <a title1="江西省" data-code="360000" class="">江西省</a>
                                                        <a title1="吉林省" data-code="220000" class="">吉林省</a>
                                                    </dd>
                                                </dl>
                                                <dl class="clearfix">
                                                    <dt>L-S</dt>
                                                    <dd>
                                                        <a title1="辽宁省" data-code="210000" class="">辽宁省</a>
                                                        <a title1="内蒙古自治区" data-code="150000" class="">内蒙古自治区</a>
                                                        <a title1="宁夏回族自治区" data-code="640000" class="">宁夏回族自治区</a>
                                                        <a title1="青海省" data-code="630000" class="">青海省</a>
                                                        <a title1="山东省" data-code="370000" class="">山东省</a>
                                                        <a title1="上海市" data-code="310000" class="">上海市</a>
                                                        <a title1="山西省" data-code="140000" class="">山西省</a>
                                                        <a title1="陕西省" data-code="610000" class="">陕西省</a>
                                                        <a title1="四川省" data-code="510000" class="">四川省</a>
                                                    </dd>
                                                </dl>
                                                <dl class="clearfix">
                                                    <dt>T-Z</dt>
                                                    <dd>
                                                        <a title1="天津市" data-code="120000" class="">天津市</a>
                                                        <a title1="新疆维吾尔自治区" data-code="650000" class="">新疆维吾尔自治区</a>
                                                        <a title1="西藏自治区" data-code="540000" class="">西藏自治区</a>
                                                        <a title1="云南省" data-code="530000" class="">云南省</a>
                                                        <a title1="浙江省" data-code="330000" class="">浙江省</a>
                                                    </dd>
                                                </dl>
                                            </div>
                                            <div class="city-select city" data-count="city" style="display: none;">
                                                <dl class="clearfix">
                                                    <dd></dd>
                                                </dl>
                                            </div>
                                            <div class="city-select district" data-count="district" style="display: none;">
                                                <dl class="clearfix">
                                                    <dd></dd>
                                                </dl>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <span id="inputError2" for="list_area" class="label label-danger" style="visibility: hidden">所在地区必填(省份、城市、区县)</span>
                            </div>
                            <br>
                            <br>
                            <label for="schoolType" class="col-sm-2 control-label">*学校类型</label>
                            <div class="col-sm-9" style="height: 55px;">
                                <div>
                                    <select id="schoolType" class="form-control">
                                        <option value="-1" selected="selected">选择学校类型</option>
                                        <option value="小学">小学</option>
                                        <option value="初中">初中</option>
                                        <option value="高中">高中</option>
                                        <option value="完全中学">完全中学</option>
                                        <option value="大学">大学</option>
                                        <option value="培训机构">培训机构</option>
                                        <option value="竞品公司">竞品公司</option>
                                        <option value="其他">其他</option>
                                    </select>
                                </div>
                                <span id="inputError6" for="schoolType" class="label label-danger" style="visibility: hidden">学校类型必选</span>
                            </div>
                            <br>
                            <br>
                            <hr style="width: 100%; height: 1px; float: left;">
                            <div>
                                <label for="list_job" class="col-sm-2 control-label">*您的职务</label>
                                <div class="col-sm-9" style="height: 55px; width: 165px;">
                                    <div>
                                        <select id="list_job" class="form-control">
                                            <option value="-1" selected="selected">选择您的职务</option>
                                            <option value="教务处负责人">教务处负责人</option>
                                            <option value="信息负责人">信息负责人</option>
                                            <option value="年级主任">年级主任</option>
                                            <option value="教学组长">教学组长</option>
                                            <option value="理科教师">理科教师</option>
                                            <option value="文科教师">文科教师</option>
                                            <option value="教学副校长">教学副校长</option>
                                        </select>
                                    </div>
                                    <span id="inputError7" for="list_job" class="label label-danger" style="visibility: hidden">职务必选</span>
                                </div>
                                <label for="list_age" class="col-sm-2 control-label">*您的年龄</label>
                                <div class="col-sm-9" style="height: 55px; width: 165px;">
                                    <div>
                                        <select id="list_age" class="form-control">
                                            <option value="-1" selected="selected">选择您的年龄</option>
                                            <option value="20岁-25岁">20岁-25岁</option>
                                            <option value="25岁-30岁">25岁-30岁</option>
                                            <option value="30岁-35岁">30岁-35岁</option>
                                            <option value="35岁-40岁">35岁-40岁</option>
                                            <option value="40岁-45岁">40岁-45岁</option>
                                            <option value="45岁-50岁">45岁-50岁</option>
                                            <option value="50岁以上">50岁以上</option>
                                        </select>
                                    </div>
                                    <span id="inputError8" for="list_age" class="label label-danger" style="visibility: hidden">年龄必选</span>
                                </div>
                            </div>
                            <br>
                            <br>
                            <label for="list_phone" class="col-sm-2 control-label">*联系电话</label>
                            <div class="col-sm-9" style="height: 55px;">
                                <div>
                                    <input id="list_phone" type="text" class="form-control" placeholder="联系电话" aria-describedby="basic-addon1" maxlength="11"
                                        style="display: inline;">
                                </div>
                                <span id="inputError3" for="list_phone" class="label label-danger" style="visibility: hidden">无效联系电话</span>
                            </div>
                            <br>
                            <br>
                            <label for="list_qq" class="col-sm-2 control-label">联系QQ</label>
                            <div class="col-sm-9" style="height: 55px;">
                                <div>
                                    <input id="list_qq" type="text" class="form-control" placeholder="" aria-describedby="basic-addon1" maxlength="20">
                                </div>
                                <span id="inputError4" for="list_qq" class="label label-danger" style="visibility: hidden">无效QQ号</span>
                            </div>
                            <br>
                            <br>
                            <label for="list_mail" class="col-sm-2 control-label">联系邮箱</label>
                            <div class="col-sm-9" style="height: 55px;">
                                <div>
                                    <input id="list_mail" type="text" class="form-control" placeholder="" aria-describedby="basic-addon1" maxlength="100">
                                </div>
                                <span id="inputError5" for="list_mail" class="label label-danger" style="visibility: hidden">无效联系邮箱</span>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <!--<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>-->
                    <button id="btn_save_user_Info" type="button" class="btn btn-primary" onclick="userInfoEditor.inputUserInfo()">确定</button>
                </div>
            </div>
        </div>
        <input type="hidden" id="oldProvince">
        <input type="hidden" id="oldCity">
        <input type="hidden" id="oldDistrict">
    </div>


    <!-- Button trigger modal -->
    <button id="hiddenBtn" type="button" class="btn btn-primary btn-lg" style="display: none" data-toggle="modal" data-target="#myModalUserInfo">
    </button>
    <script type="text/javascript">
        var userInfoEditor = new UserInfoEditor();
        $('#myModalUserInfo').on('show.bs.modal', function (e) {
            $(this).find('.modal-dialog').css({
                'margin-top': function () {
                    $("#inputError1").css({ 'visibility': 'hidden' });
                    $("#inputError2").css({ 'visibility': 'hidden' });
                    $("#inputError3").css({ 'visibility': 'hidden' });
                    $("#inputError4").css({ 'visibility': 'hidden' });
                    $("#inputError5").css({ 'visibility': 'hidden' });
                    $("#inputError6").css({ 'visibility': 'hidden' });
                    $("#inputError7").css({ 'visibility': 'hidden' });
                    $("#inputError8").css({ 'visibility': 'hidden' });
                    //jQuery.ajax({
                    //    type: "GET",
                    //    url: "/m/userInfo/getUserInfo",
                    //    cache: false,
                    //    success: function (ret) {
                    //        var info = JSON.parse(ret);
                    //        $(".city-picker-span").css("width", "100%");
                    //        $(".city-picker-dropdown").css("width", "100%");
                    //        if (info.area != null && info.area != "" && info.area != undefined) {
                    //            $("#list_age").val(info.area);
                    //            var areaArray = info.area.split("-");

                    //            if (areaArray.length >= 3) {
                    //                $("span .placeholder").css("display", "none");
                    //                $("span .title1").css("display", "");
                    //                $("span .title1").empty();
                    //                $("#oldProvince").val(areaArray[0]);
                    //                $("#oldCity").val(areaArray[1]);
                    //                $("#oldDistrict").val(areaArray[2]);
                    //                $("span .title1").append("<span class='select-item' data-count='province'>" + areaArray[0] + "</span>-");
                    //                $("span .title1").append("<span class='select-item' data-count='city'>" + areaArray[1] + "</span>-");
                    //                $("span .title1").append("<span class='select-item' data-count='district'>" + areaArray[2] + "</span>");
                    //            } else if (areaArray.length >= 2) {
                    //                $("span .title1").empty();
                    //                $("span .placeholder").css("display", "none");
                    //                $("#oldProvince").val(areaArray[0]);
                    //                $("#oldCity").val(areaArray[1]);
                    //                $("span .title1").append("<span class='select-item' data-count='province'>" + areaArray[0] + "</span>-");
                    //                $("span .title1").append("<span class='select-item' data-count='city'>" + areaArray[1] + "</span>");
                    //            } else if (areaArray.length >= 1) {
                    //                $("span .title1").empty();
                    //                $("#oldProvince").val(areaArray[0]);
                    //                $("span .placeholder").css("display", "none");
                    //                $("span .title1").append("<span class='select-item' data-count='province'>" + areaArray[0] + "</span>");
                    //            }
                    //            $("#btnClose").removeAttr("style");
                    //        }
                    //        if (info.schoolName != null && info.schoolName != "" && info.schoolName != undefined) {
                    //            $("#list_school_name").val(info.schoolName);
                    //        }
                    //        if (info.phone != null && info.phone != "" && info.phone != undefined) {
                    //            $("#list_phone").val(info.phone);
                    //        }
                    //        if (info.qqNumber != null && info.qqNumber != "" && info.qqNumber != undefined) {
                    //            $("#list_qq").val(info.qqNumber);
                    //        }
                    //        if (info.userEmail != null && info.userEmail != "" && info.userEmail != undefined) {
                    //            $("#list_mail").val(info.userEmail);
                    //        }
                    //        if (info.ageArrange != null && info.ageArrange != undefined && info.ageArrange.toString() != "") {
                    //            $("#list_age").val(info.ageArrange);
                    //        }
                    //        if (info.jobType != null && info.jobType != undefined && info.jobType.toString() != "") {
                    //            $("#list_job").val(info.jobType);
                    //        }
                    //        if (info.schoolType != null && info.schoolType != undefined && info.schoolType.toString() != "") {
                    //            $("#schoolType").val(info.schoolType);
                    //        }
                    //    }
                    //});
                    $("#list_school_name").focus(function () {
                        $("#inputError1").css({ 'visibility': 'hidden' });
                    });
                    $("#list_area").focus(function () {
                        $("#inputError2").css({ 'visibility': 'hidden' });
                    });
                    $("#list_phone").focus(function () {
                        $("#inputError3").css({ 'visibility': 'hidden' });
                    });
                    $("#list_qq").focus(function () {
                        $("#inputError4").css({ 'visibility': 'hidden' });
                    });
                    $("#list_mail").focus(function () {
                        $("#inputError5").css({ 'visibility': 'hidden' });
                    });
                    $("#schoolType").change(function () {
                        $("#inputError6").css({ 'visibility': 'hidden' });
                    });
                    $("#list_job").change(function () {
                        $("#inputError7").css({ 'visibility': 'hidden' });
                    });
                    $("#list_age").change(function () {
                        $("#inputError8").css({ 'visibility': 'hidden' });
                    });
                    var modalHeight = 580; // $('#myModal').find('.modal-dialog').height();
                    return ($(window).height() / 2 - (modalHeight / 2));
                }
            });
        });
    </script>
    <script type="text/javascript">
        // 百度统计
        var _hmt = _hmt || [];
        (function () {
            var hm = document.createElement("script");
            hm.src = "//hm.baidu.com/hm.js?7c66c07d4e8cc54deba8d7f967efe75b";
            var s = document.getElementsByTagName("script")[0];
            s.parentNode.insertBefore(hm, s);
        })();
        $(document).ready(function () {
            updateSchoolView();
        });
        function loadInputTable() {
            if (userInfoEditor) {
                userInfoEditor.showUserInfoInput();
            }
        }

        function updateSchoolView() {
            //var schoolLabel = $("#label_school_name");
            //jQuery.ajax({
            //    type: "GET",
            //    url: "/m/userInfo/getSchoolName",
            //    cache: false,
            //    success: function (ret) {
            //        var userInfoButton = $("#btn_add_userInfo");
            //        userInfoButton.css({ 'visibility': 'visible' });
            //        if (ret.split(",")[0] == "") {
            //            //从未填写过学校信息
            //            userInfoButton.text("添加");
            //            $("#btn_add_task").attr('disabled', true);
            //            $("#btn_add_task_first").attr('disabled', true);
            //            schoolLabel.text("学校: 未填写");
            //            loadInputTable();
            //        } else {
            //            userInfoButton.text("修改");
            //            $("#btn_add_task").attr('disabled', false);
            //            $("#btn_add_task_first").attr('disabled', false);
            //            schoolLabel.text("学校: " + ret.split(",")[0]);
            //            if (ret.split(",")[1] == "") {
            //                loadInputTable();
            //            }
            //        }
            //        schoolLabel.css({ 'visibility': 'visible' });
            //    }
            //});
        }
    </script>


    @if (t_class_attachment_info_BLL.CheckAttachmentExists(ViewBag.CurrentUser.id) == 0)
    {
        <script type="text/javascript">
            // 后台检测是否已经完赛了个人信息，来决定是否弹出这个对话框
            $("#hiddenBtn").click();
        </script>
    }
}



<div id="divbody" style="min-height: 547px;">
    <div class="container" id="divcon">
        <style>
            .row-border {
                border-bottom: 2px solid #c6c6c6;
            }

            .table th {
                text-align: center;
                border-right: 1px solid #c6c6c6;
                font-size: 16px;
            }

            .table td {
                text-align: center;
                font-size: 14.8px;
            }

            .field-color {
                color: #038cda;
            }

                .field-color a {
                    text-decoration: none;
                }

            .status {
                width: 100px;
                color: #666;
                /*color: #ec5d41;*/
            }

                .status span {
                    cursor: pointer;
                }

                .status img {
                    vertical-align: top;
                }

            .control-container a {
                padding-left: 21px;
                background-repeat: no-repeat;
                margin-left: 8px;
                text-decoration: none;
            }

            .control-container .disabled {
                color: #adacac;
                cursor: default;
            }

            .control-container a.execute {
                background-image: url("/static/img/paike.png");
            }

            .control-container a.execute_ {
                background-image: url("/static/img/paikeadac.png");
            }

            .control-container a.remove {
                background-image: url("/static/img/delete.png");
            }

            .control-container a.remove_ {
                background-image: url("/static/img/deleteadac.png");
            }

            .control-container a.view {
                display: block;
                background-image: url("/static/img/chakankebiao.png");
            }

            .control-container a.view_ {
                display: block;
                background-image: url("/static/img/chakankebiaoadac.png");
            }

            .control-container a.copy {
                background-image: url("/static/img/fuyong.png");
            }

            .control-container a.copy_ {
                background-image: url("/static/img/fuyongadac.png");
            }

            .control-container a.edit {
                padding-left: 0px;
            }

            .list-inline a {
                font-size: 14.8px;
                color: #000;
                padding: 0px;
            }

                .list-inline a.red {
                    font-size: 14.8px;
                    color: #ff0000;
                }

            .alert {
                margin-left: 40px;
                width: 480px;
            }

            .control-container a.share {
                background-image: url("/static/img/share.png");
            }
        </style>
        <script type="text/javascript">
            var totalCount = 0;
        </script>


        <div class="row" id="row" style="padding-top: 11px">
            <div class="col-md-8">
                <div style="width: 210px;">
                    <button id="btn_add_task" title="点击新增排课任务" type="button" class="btn btn-primary btn-md" style="font-weight: bold; display: none;"
                        data-toggle="modal" data-target="#myModal" onclick="beginAdd(&#39;${task.id}&#39;);return false;">
                        新增排课任务
                       
                    </button>
                </div>
            </div>
        </div>



        <!-- addModal -->
        <div class="modal fade" id="myModal" tabindex="-1" role="dialog" data-backdrop="static" aria-labelledby="myModalLabel" aria-hidden="true"
            style="display: none;">
            <input id="modelTaskType" value="0" type="hidden">
            <div class="modal-dialog" style="margin-top: 221px;">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal">
                            <span aria-hidden="true">×</span>
                        </button>
                        <div class="modal-title" id="myModalLabel">
                            <b>添加排课任务</b>
                        </div>
                    </div>
                    <div class="modal-body">
                        <form class="form-horizontal" role="form">
                            <div class="form-group">
                                <label for="txtName" class="col-sm-2 control-label">
                                    <span style="color: #ff0000">*</span>名称
                                   
                                </label>

                                <div class="col-sm-9">
                                    <input type="text" class="form-control" id="txtName">
                                </div>
                            </div>
                            <div class="form-group" style="display: none">
                                <label for="txtPeriod" class="col-sm-2 control-label">学期</label>

                                <div class="col-sm-9">
                                    <input type="text" class="form-control" id="txtPeriod">
                                </div>
                            </div>
                        </form>
                    </div>
                    <div class="modal-footer">
                        <div class="col-sm-7" style="color: #619CC5; text-align: left;">
                            <span>走班课表怎么排？联系在线客服~</span>
                            <br>
                            <span>专业排课师3天排出优质课表</span>
                        </div>
                        <button id="btn_cancel_1" type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                        <button id="btn_save_1" type="button" class="btn btn-primary">保存</button>
                        <input type="hidden" value="0" id="copyId">
                        <input type="hidden" value="0" id="status">
                    </div>
                </div>
            </div>
        </div>

        <!-- update Modal -->
        <div class="modal fade" id="myUpdateModal" tabindex="-1" role="dialog" data-backdrop="static" aria-labelledby="myUpdateModalLabel"
            aria-hidden="true">
            <input id="=taskType" value="0" type="hidden">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal">
                            <span aria-hidden="true">×</span>
                        </button>
                        <div class="modal-title" id="myUpdateModalLabel">
                            <b>修改任务</b>
                        </div>
                    </div>
                    <div class="modal-body">

                        <form class="form-horizontal" role="form">
                            <div class="form-group">
                                <label for="txtName" class="col-sm-2 control-label">
                                    <span style="color: #ff0000">*</span>名称
                                   
                                </label>

                                <div class="col-sm-9">
                                    <input type="text" class="form-control" id="updateTxtName">
                                </div>
                            </div>
                            <div class="form-group" style="display: none">
                                <label for="txtPeriod" class="col-sm-2 control-label">学期</label>

                                <div class="col-sm-9">
                                    <input type="text" class="form-control" id="updateTxtPeriod">
                                </div>
                            </div>
                        </form>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                        <button type="button" class="btn btn-primary" onclick="updateTask();">确认</button>
                    </div>
                </div>
            </div>
        </div>

        <div style="margin-top: 20px; display: none;" id="showList">
            <table class="table table-striped row-border">
                <thead>
                    <tr class="row-border">
                        <th>名称</th>
                        <th>类型</th>
                        <th>状态</th>
                        <th>创建时间</th>
                        <th style="width: 180px">用户</th>
                        <th style="width: 290px; border-right: 0px solid #fff">操作</th>
                    </tr>
                </thead>
                <tbody>
                </tbody>
            </table>
            <div id="result">
                <div id="resultMsg" style="font-size: 14px; padding: 5px; line-height: 22px;"></div>
            </div>
        </div>

        <div class="p2" style="text-align: center; margin-top: 150px">
            <div class="btn-lg" style="text-align: center; color: #ff0000">请点击“新增排课任务”，开始愉快的云校排课之旅吧！</div>
            <div style="text-align: center">
                <button id="btn_add_task_first" type="button" class="btn btn-primary btn-md" style="font-weight: bold" data-toggle="modal"
                    data-target="#myModal" @*onclick="beginAdd(&#39;${task.id}&#39;);return false;"*@>
                    新增排课任务
                   
                </button>
            </div>
        </div>

        <!--分享-->
        <div class="modal fade" id="myShareModal" tabindex="-1" role="dialog" data-backdrop="static" aria-labelledby="myModalLabel"
            aria-hidden="true">
            <div class="modal-dialog" style="margin-top: 300px">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal">
                            <span aria-hidden="true">×</span>
                        </button>
                        <div class="modal-title" id="myModalLabel">
                            <b>任务分享</b>
                        </div>
                    </div>
                    <div class="modal-body">
                        <div>此排课任务将分享以下人员，他们只能查看排课任务</div>
                        <div>
                            <label style="font-weight: normal">
                                <input type="checkbox" id="chkSelectAllShareUser" onclick="selectAllShareUser(this);">
                                全选</label>
                        </div>
                        <div style="height: 200px; overflow-y: scroll" id="shareUserList">
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button id="btn_cancel" type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                        <button id="btn_save" type="button" class="btn btn-primary" onclick="doShareTask();">分享</button>
                        <input type="hidden" value="0" id="shareTaskId">
                    </div>
                </div>
            </div>
        </div>

        <script src="/Static/Template/js/task-share.js" charset="UTF-8"></script>
        <script src="/Static/Template/js/jquery-ui.js"></script>
        <link href="/Static/Template/css/jquery-ui.css" rel="stylesheet">
        <script src="/Static/Template/js/list.js" charset="UTF-8"></script>
    </div>
</div>


@section scripts {
    <script type="text/javascript">

        $(function () {
            //
            $("#btn_save_1").on("click", function () {
                var name = $("#txtName").val();
                if (!name) { alert("名称不能为空!"); return; }

                var requestObj = {
                    url: "/ScheduleClass/AddClassTask",
                    type: "POST",
                    data: {
                        name: name
                    },
                    dataType: "json",
                    success: function (data) {
                        if (data.status) {
                            // alert("数据添加成功!");
                            window.location.href = "ArrangeTaskList";
                        }
                    }
                };

                $.ajax(requestObj);
            });
        })

    </script>
}